﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class DepartmentLeaderPositionBL
	{

		#region ***** Init Methods ***** 
		DepartmentLeaderPositionDA objDepartmentLeaderPositionDA;
		public DepartmentLeaderPositionBL()
		{
			objDepartmentLeaderPositionDA = new DepartmentLeaderPositionDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get DepartmentLeaderPosition by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>DepartmentLeaderPosition</returns>
		public DepartmentLeaderPosition GetByID(int id)
		{
			return objDepartmentLeaderPositionDA.GetByID(id);
		}

		/// <summary>
		/// Get all of DepartmentLeaderPosition
		/// </summary>
		/// <returns>List<<DepartmentLeaderPosition>></returns>
		public List<DepartmentLeaderPosition> GetList()
		{
			string cacheName = "lstDepartmentLeaderPosition";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objDepartmentLeaderPositionDA.GetList(), "DepartmentLeaderPosition");
			}
			return (List<DepartmentLeaderPosition>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of DepartmentLeaderPosition
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsDepartmentLeaderPosition";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objDepartmentLeaderPositionDA.GetDataSet(), "DepartmentLeaderPosition");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of DepartmentLeaderPosition paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<DepartmentLeaderPosition>></returns>
		public List<DepartmentLeaderPosition> GetListPaged(int recperpage, int pageindex)
		{
			return objDepartmentLeaderPositionDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of DepartmentLeaderPosition paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objDepartmentLeaderPositionDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new DepartmentLeaderPosition within DepartmentLeaderPosition database table
		/// </summary>
		/// <param name="obj_departmentleaderposition">DepartmentLeaderPosition</param>
		/// <returns>key of table</returns>
		public int Add(DepartmentLeaderPosition obj_departmentleaderposition)
		{
			ServerCache.Remove("DepartmentLeaderPosition", true);
			return objDepartmentLeaderPositionDA.Add(obj_departmentleaderposition);
		}

		/// <summary>
		/// updates the specified DepartmentLeaderPosition
		/// </summary>
		/// <param name="obj_departmentleaderposition">DepartmentLeaderPosition</param>
		/// <returns></returns>
		public void Update(DepartmentLeaderPosition obj_departmentleaderposition)
		{
			ServerCache.Remove("DepartmentLeaderPosition", true);
			objDepartmentLeaderPositionDA.Update(obj_departmentleaderposition);
		}

		/// <summary>
		/// Delete the specified DepartmentLeaderPosition
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("DepartmentLeaderPosition", true);
			objDepartmentLeaderPositionDA.Delete(id);
		}
		#endregion
	}
}
